<?php $this->pageTitle=Yii::app()->name; ?>
<script type="text/javascript">
	$(document).ready(function(){
		$("#featured").tabs({fx:[{opacity: "toggle", duration: 'slow'}, {opacity: "toggle", duration: 'normal'}],
			show: function(event, ui){
				$('#featured .ui-tabs-panel .info').hide();
				var infoheight=$('.info', ui.panel).height();
				$('.info', ui.panel).css('height', '0px').animate({ 'height': infoheight }, 0);
			}
		}).tabs("rotate", 5000, true);
		$('#featured').hover(
			function(){ $('#featured').tabs('rotate', 0, true); },
			function(){ $('#featured').tabs('rotate', 5000, true); }
		);
		
	});
</script>
<div id="tin_noi_bat" style="width:547px;">
	<h1>Tin tức nổi bật</h2>
	
	<!--<img src="/thcs/css/images/noibat.png">-->
	<!---Imge slid show-->
	<div id="featured" >
		<?php 
			$tintuc= new Tintuc();
			$url=Yii::app()->request->baseUrl;
			$noiBat = $tintuc->selectUuTien();
			echo '<ul class="ui-tabs-nav">';
			$i=1;
			foreach($noiBat as $row){
				echo'
					 
					<li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-'.$i.'"><a href="#fragment-'.$i.'"><img src="'.$url.'/images/tintuc/'.$row["hinh_anh"].'" style="width:65px" alt="" /><span>'.$row["tieu_de"].'</span></a></li>
				';
			$i++;
			}
			echo '  </ul>';
			$i=1;
			foreach($noiBat as $row){
				echo '	
					<div id="fragment-'.$i.'" class="ui-tabs-panel" style="">
						<img src="'.$url.'/images/tintuc/'.$row["hinh_anh"].'" style="width:350px" alt="" />
						 <div class="info" >
							<h2><a href="'.$url.'/site/view/'.$row['id'].'" >'.$row["tieu_de"].'</a></h2>
							<p>'.$row["noi_dung_trich"].'</a></p>
						 </div>
					</div>
				';
				
				$i++;	
			}	
		?>	
	
	</div>	
	<!---End imge show--->
	<img src="/thcs/css/images/noibat.png">
</div>	
<div class="tintuc">
	<h1><img src="/thcs/css/images/Live_icon.png" width="16px">Tin giáo dục</h1>
	<div class="tintuc_dm">
		<?php 
			$topOne= $tintuc->selectTP(1);
			$id1="";
			foreach( $topOne as $row){
				if($row["hinh_anh"]==null){
					$row["hinh_anh"] = "137638513520130813_image5.jpg";
				}
				echo '<div class="noidung_dm">
						<a href="'.$url.'/site/view/id/'.$row["id"].'"><img src="'.$url.'/images/tintuc/'.$row["hinh_anh"].'" width="80px"></a>
						<a href="'.$url.'/site/view/id/'.$row["id"].'">'.$row["tieu_de"].'</a>
						<p>'.$row["noi_dung_trich"].'</p>
						<div id="readMore"><a href="'.$url.'/site/view/id/'.$row["id"].'">Xem tiếp</a></div>
					</div>';
				$id1=$row["id"];	
			}
			
		?>
		<div class="clear"><hr></div>
		<ul>
			<?php
				if($id1!=""){
					$topList=$tintuc->selectListTP(1, $id1,4);
					foreach($topList as $row){
						echo '<li><a href="'.$url.'/site/view/id/'.$row["id"].'">'.$row["tieu_de"].'</a></li>';
					}
				}	
			?>
		</ul>
	</div>
</div>
<div class="tintuc">
	<h1><img src="/thcs/css/images/Live_icon.png" width="16px">Tin hoạt động</h1>
	<div class="tintuc_dm">
		<?php 
			$tintuc= new Tintuc();
			$topOne= $tintuc->selectTP(2);
			$id1="";
			$url=Yii::app()->request->baseUrl;
			foreach( $topOne as $row){
				if($row["hinh_anh"]==null){
					$row["hinh_anh"] = "137638513520130813_image5.jpg";
				}
				echo '<div class="noidung_dm">
						<a href="'.$url.'/site/view/id/'.$row["id"].'"><img src="'.$url.'/images/tintuc/'.$row["hinh_anh"].'" width="80px"></a>
						<a href="'.$url.'/site/view/id/'.$row["id"].'">'.$row["tieu_de"].'</a>
						<p>'.$row["noi_dung_trich"].'</p>
						<div id="readMore"><a href="'.$url.'/site/view/id/'.$row["id"].'">Xem tiếp</a></div>
					</div>';
				$id1=$row["id"];	
			}
			
		?>
		<div class="clear"><hr></div>
		<ul>
			<?php
				if($id1!=""){
					$topList=$tintuc->selectListTP(2, $id1,4);
					foreach($topList as $row){
						echo '<li><a href="'.$url.'/site/view/id/'.$row["id"].'">'.$row["tieu_de"].'</a></li>';
					}
				}	
			?>
		</ul>
	</div>
</div>
<div class="tintuc">
	<h1><img src="/thcs/css/images/Live_icon.png" width="16px">Thông báo</h1>
	<div class="tintuc_dm">
		<?php 
			$tintuc= new Tintuc();
			$topOne= $tintuc->selectTP(4);
			$id1="";
			$url=Yii::app()->request->baseUrl;
			foreach( $topOne as $row){
				if($row["hinh_anh"]==null){
					$row["hinh_anh"] = "137638513520130813_image5.jpg";
				}
				echo '<div class="noidung_dm">
						<a href="'.$url.'/site/view/id/'.$row["id"].'"><img src="'.$url.'/images/tintuc/'.$row["hinh_anh"].'" width="80px"></a>
						<a href="'.$url.'/site/view/'.$row["id"].'">'.$row["tieu_de"].'</a>
						<p>'.$row["noi_dung_trich"].'</p>
						<div id="readMore"><a href="'.$url.'/site/view/id/'.$row["id"].'">Xem tiếp</a></div>
					</div>';
				$id1=$row["id"];	
			}
			
		?>
		<div class="clear"><hr></div>
		<ul>
			<?php
				if($id1!=""){
					$topList=$tintuc->selectListTP(4, $id1,4);
					foreach($topList as $row){
						echo '<li><a href="'.$url.'/site/view/id/'.$row["id"].'">'.$row["tieu_de"].'</a></li>';
					}
				}	
			?>
		</ul>
	</div>
</div>